import request from '@/sheep/request';

export default {
  // 获取聊天token
  unifiedToken: () =>
    request({
      url: 'index/unifiedToken',
      custom: {
        showError: false,
        showLoading: false,
      },
    }),

  // 发送消息
  nc_sendText: (data) =>
    request({
      url: '/api/chat/send',
      method: 'POST',
      data,
      custom: {
        showLoading: false,
      },
    }),

  // 发送消息
  nc_chat_list: (data) =>
    request({
      url: '/api/chat/list',
      method: 'POST',
      data
    }),

  // 获取用户会话列表
  nc_chat_session: (data) =>
    request({
      url: '/api/chat/getUserSessions',
      method: 'POST',
      data,
      custom: {
        showLoading: false,
      },
    }),

  // 获取用户会话列表
  defaultSessionList: (data) =>
    request({
      url: '/api/chat/defaultSessionList',
      method: 'POST',
      data,
      custom: {
        showLoading: false,
      },
    }),

  // 关注AI
  nc_chat_follow: (data) =>
    request({
      url: '/api/user/addFollowing',
      method: 'POST',
      data,
      custom: {
        showLoading: false,
      },
    }),
  // 取消关注AI
  nc_chat_cancel_follow: (data) =>
    request({
      url: '/api/user/removeFollowing',
      method: 'POST',
      data,
      custom: {
        showLoading: false,
      },
    }),
  // 获取关注列表
  nc_chat_follow_list: (data) =>
    request({
      url: '/api/user/getFollowings',
      method: 'POST',
      data,
      custom: {
        showLoading: false,
      },
    }),
  // 获取默认关注列表
  getDefaultFollowings: (data) =>
    request({
      url: '/api/user/getDefaultFollowings',
      method: 'POST',
      data,
      custom: {
        showLoading: false,
      },
    }),
  // 创建机器人会话
  createBotSession: (data) =>
    request({
      url: '/api/chat/createBotSession',
      method: 'POST',
      data,
      custom: {
        showLoading: false,
      },
    }),
  // 创建机器人会话消息
  addUserMessage: (data) =>
    request({
      url: '/api/chat/addUserMessage',
      method: 'POST',
      data,
      custom: {
        showLoading: false,
      },
    }),
  bind: (data) => {
    return request({
      url: '/api/bind/bind',
      method: 'POST',
      data,
      custom: {
        showLoading: false,
      },
    });
  },
  read: (data) =>
    request({
      url: '/api/chat/read',
      method: 'POST',
      data,
      custom: {
        showLoading: false,
      },
    }),
};
